"""
pip install baidu-aip
"""

from aip import AipOcr

""" 你的 APPID AK SK """
APP_ID = '30863256'
API_KEY = '92eOqkOQyZavGGMULLd2DGAx'
SECRET_KEY = 'VM7M49DFfFhaYCGEmULGrkm6QbfwvYly'

# 识别图片的对象
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

with open('1.gif', "rb") as fp:
    image = fp.read()

# 调用通用文字识别（高精度版）
res_image = client.basicAccurate(image)['words_result'][0]['words']
print(res_image)
